package com.fenghongzhang.day008test;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class Main3Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);

        //1,2
        SharedPreferences register = getSharedPreferences("register", MODE_PRIVATE);
        boolean isStart = register.getBoolean("isStart", false);
        if(isStart){
            //跳转
            Intent intent = new Intent(this, Main2Activity.class);
            startActivity(intent);
            finish();
            return;
        }
        //不执行了.
        SharedPreferences.Editor edit = register.edit();
        edit.putBoolean("isStart",true);
        edit.commit();
    }
}
